
#include <cassert>
#include <iostream>
#include <vector>
using namespace std;

struct StrArr {
  int i{2};
  bool b{false};
  char c{'c'};
  double d{1.0};
  int i2{10};
};

int main() {
  const int size = 4;
  vector<StrArr> arr(size);

  char *iptr = (char *)&arr[0].i;
  char *bptr = (char *)&arr[0].b;
  char *cptr = (char *)&arr[0].c;
  char *dptr = (char *)&arr[0].d;
  char *i2ptr = (char *)&arr[0].i2;

  void *vptr = &arr[0].i2;
  char *i3ptr = (char *)vptr;

  const int str_size = sizeof(StrArr);

  for (int i = 0; i < size; ++i) {
    cout << *(int *)(iptr + i * str_size) << "\n";
    cout << *(bool *)(bptr + i * str_size) << "\n";
    cout << *(char *)(cptr + i * str_size) << "\n";
    cout << *(double *)(dptr + i * str_size) << "\n";
    cout << *(int *)(i2ptr + i * str_size) << "\n";
    cout << *(int *)(i3ptr + i * str_size) << "\n";
    cout << "\n";
  }
  return 0;
}